//分为有1无1，
#include <iostream>
using namespace std;
int f(int n,int k)
{
  if(n==0||k==0||n<k)
    return 0;
  if(k==1||n==k)
    return 1;
  else
    return f(n-k,k)+f(n-1,k-1);
}

int main()
{
  int n,k,count=0;
  scanf("%d %d",&n,&k);
  //无1,f(n-k,k):剩余n-k分成k份;有1，f(n-1,k-1),所以f(n,k)=f(n-k,k)+f(n-1,k-1)
  cout<<f(n,k)<<'\n';
  return 0;
}